﻿using project.B12.Model.BaseModel;
using project.B12.Model.Enums;
using software.Common.MVVM;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace project.B12.Model.Models
{
    /// <summary>
    /// 菌数据库
    /// </summary>
    [SugarTable("TB_bacteria")]
    [TenantAttribute("0")]//对应ConfigId
    public class Table_bacteria : AggregateRootEntity
    {

        public Table_bacteria() { }

        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 菌中文名称
        /// </summary>
        private string _name;
        [SugarColumn(IsNullable = false)]
        public string CN_Name
        {
            get { return _name; }
            set { _name = value; this.RaisePropertyChanged(); }
        }

        /// <summary>
        /// 菌英文名称
        /// </summary>
        private string _englishName;
        [SugarColumn(IsNullable = true)]
        public string EN_Name
        {
            get { return _englishName; }
            set
            {
                _englishName = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 菌简称
        /// </summary>
        private string _abbreviation;
        [SugarColumn(IsNullable = true)]
        public string Abbreviation
        {
            get { return _abbreviation; }
            set
            {
                _abbreviation = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 层级
        /// </summary>
        private BacteriaLevel level;
        [SugarColumn(IsNullable = true)]
        public BacteriaLevel Level
        {
            get { return level; }
            set
            {
                level = value;
                this.RaisePropertyChanged();
            }
        }


        /// <summary>
        /// 界
        /// </summary>
        private string _kingdom;
        [SugarColumn(IsNullable = false)]
        public string Kingdom
        {
            get { return _kingdom; }
            set
            {
                _kingdom = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 门
        /// </summary>
        private string _phylum;
        [SugarColumn(IsNullable = false)]
        public string Phylum
        {
            get { return _phylum; }
            set
            {
                _phylum = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 纲
        /// </summary>
        private string _class;
        [SugarColumn(IsNullable = false)]
        public string Class
        {
            get { return _class; }
            set
            {
                _class = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 目
        /// </summary>
        private string _order;
        [SugarColumn(IsNullable = false)]
        public string Order
        {
            get { return _order; }
            set
            {
                _order = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 科
        /// </summary>
        private string _family;
        [SugarColumn(IsNullable = false)]
        public string Family
        {
            get { return _family; }
            set
            {
                _family = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 属
        /// </summary>
        private string _genus;
        [SugarColumn(IsNullable = false)]
        public string Genus
        {
            get { return _genus; }
            set
            {
                _genus = value;
                this.RaisePropertyChanged();
            }
        }


        /// <summary>
        /// 种
        /// </summary>
        private string _species;
        [SugarColumn(IsNullable = false)]
        public string Species
        {
            get { return _species; }
            set
            {
                _species = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 判读方法
        /// </summary>
        private int _read = 1;
        [SugarColumn(IsNullable = true)]
        public int Read
        {
            get { return _read; }
            set
            {
                _read = value;
                this.RaisePropertyChanged();
            }
        }


        /// <summary>
        /// 备注
        /// </summary>
        private string _remarks;
        [SugarColumn(IsNullable = true)]
        public string Remarks
        {
            get { return _remarks; }
            set
            {
                _remarks = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 是否删除
        /// </summary>
        private bool _isDelete;
        [SugarColumn(IsNullable = true)]
        public bool IsDelete
        {
            get { return _isDelete; }
            set
            {
                _isDelete = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// 是否已修改
        /// </summary>
        private bool isUpdate;
        [SugarColumn(IsIgnore = true)]
        public bool IsUpdate
        {
            get { return isUpdate; }
            set
            {
                isUpdate = value;
                this.RaisePropertyChanged();
            }
        }

        /// <summary>
        /// false 表示需要添加
        /// </summary>
        private bool isAdd;
        [SugarColumn(IsIgnore = true)]
        public bool IsAdd
        {
            get { return isAdd; }
            set
            {
                isAdd = value;
                this.RaisePropertyChanged();
            }
        }
    }
}
